/**
 * 社区分享相关类型定义
 * 预留用于未来实现社区功能
 */

export interface PromptShareData {
  id: string;
  promptId: string;
  prompt: SharedPromptTemplate;
  sharedBy: UserInfo;
  sharedAt: Date;
  stats: ShareStats;
  permissions: SharePermissions;
  tags: string[];
  category: string;
  language: string;
  version: string;
}

export interface SharedPromptTemplate {
  name: string;
  description: string;
  content: string;
  variables: PromptVariable[];
  category: 'role' | 'style' | 'domain' | 'custom';
  tags: string[];
  examples?: PromptExample[];
  performance?: PromptPerformance;
}

export interface PromptVariable {
  name: string;
  type: 'string' | 'number' | 'select' | 'boolean';
  required: boolean;
  defaultValue?: any;
  options?: string[];
  description?: string;
}

export interface PromptExample {
  input: string;
  output: string;
  variables?: Record<string, any>;
}

export interface PromptPerformance {
  avgResponseTime: number;
  avgTokenCount: number;
  successRate: number;
  userRating: number;
}

export interface UserInfo {
  id: string;
  username: string;
  avatar?: string;
  reputation?: number;
  verified?: boolean;
}

export interface ShareStats {
  views: number;
  downloads: number;
  likes: number;
  comments: number;
  forks: number;
  rating: number;
  ratingCount: number;
}

export interface SharePermissions {
  isPublic: boolean;
  allowFork: boolean;
  allowComment: boolean;
  allowRating: boolean;
  requireAttribution: boolean;
  license?: 'MIT' | 'Apache-2.0' | 'GPL-3.0' | 'CC-BY-4.0' | 'Custom';
}

export interface CommunitySearchParams {
  query?: string;
  category?: string;
  tags?: string[];
  language?: string;
  sortBy?: 'popular' | 'recent' | 'rating' | 'downloads';
  timeRange?: 'day' | 'week' | 'month' | 'year' | 'all';
  page?: number;
  pageSize?: number;
}

export interface CommunityAPIEndpoints {
  share: '/api/v1/community/prompts/share';
  search: '/api/v1/community/prompts/search';
  get: '/api/v1/community/prompts/:id';
  download: '/api/v1/community/prompts/:id/download';
  like: '/api/v1/community/prompts/:id/like';
  comment: '/api/v1/community/prompts/:id/comments';
  rate: '/api/v1/community/prompts/:id/rate';
  fork: '/api/v1/community/prompts/:id/fork';
  report: '/api/v1/community/prompts/:id/report';
  stats: '/api/v1/community/prompts/:id/stats';
}